#ifndef _ECHOSERVER_H
#define _ECHOSERVER_H
#include "TcpConnection.hpp"
#include "TcpServer.hpp"
#include "ThreadPool.hpp"
#include "ffmpeg.hpp"
#include <map>
#include <thread>
using std::thread;
using std::map;
class EchoServer
{
public:
    EchoServer(int thread_size,int task_size,uint16_t port,string ip = "0.0.0.0");
    void onMessage(TcpConnectionPtr);
    void onConnect(TcpConnectionPtr);
    void onClose(TcpConnectionPtr);
    void start();
    void stop();
    ~EchoServer() {}

private:
    ThreadPool _pool;
    ThreadPool _lpool;
    TcpServer _tcpServer;
    map<int,RtspDecoder> _ffmpegs;
};
#endif

